<template>
	<view class="main">
		<u-navbar :is-back="true" title="报修" :background="background" title-size="32" title-color="#000"  :border-bottom="false" ></u-navbar>
		<view class="content">
			<view class="top">
				<text>类目选择</text>
				<view class="select">
					<text v-if="content.repairCategory=='01'">水</text>
					<text v-if="content.repairCategory=='02'">电</text>
					<text v-if="content.repairCategory=='03'">门</text>
				</view>
			</view>
			<view class="top">
				<text>联系电话</text>
				<view class="select">
				<text>{{content.contactNumber}}</text>
				</view>
			</view>
			<view class="top">
				<text>楼牌号</text>
				<view class="select">
					<text>{{content.repairInfo}}</text>
				</view>
			</view>
			<view class="question">
				<view class="titles">
					问题描述
				</view>
				<text>{{content.problemDescription}}</text>
			</view>
		</view>
		<view class="button">
			已处理
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				types: '',
				show: false,
				list: [{
						label: '水'
					},
					{
						label: '电'
					}
				],
				content: {}
			}
		},
		onLoad() {
			var that = this
			const eventChannel = this.getOpenerEventChannel();
			// 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
			eventChannel.on('details', function(data) {
				console.log(data);
				that.content = data
			})
		},
		onShow() {},
		methods: {
			select() {
				this.show = true
			},
			confirm(e) {
				console.log(e[0].label);
				this.types = e[0].label
			}
		}
	}
</script>

<style lang="scss">
	page {
		font-family: PingFang SC;
		background-color: #f7f7f7;

		.main {
			width: 750rpx;

			.content {
				.top {
					margin: 2rpx 0;
					background-color: #fff;
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding: 31rpx 30rpx 31rpx 37rpx;

					.select {
						display: flex;
						align-items: center;

						text {
							font-size: 28rpx;
							font-family: PingFang SC;
							font-weight: 400;
							color: #000;
							padding-right: 23rpx;
						}

						image {
							width: 8rpx;
							height: 14rpx;
						}


					}
				}

				.question {
					margin-top: 10rpx;
					background-color: #fff;
					padding: 30rpx 38rpx;
					height: 330rpx;

					.titles {
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #000000;
						padding-bottom: 30rpx;
						border-bottom: 1rpx solid #f7f7f7;
					}

					text {
						display: block;
						padding-top: 25rpx;
						font-size: 26rpx;
					}
				}
			}

			.button {
				width: 540rpx;
				margin: 365rpx auto 0 auto;
				height: 80rpx;
				line-height: 80rpx;
				text-align: center;
				background: #CDCDCD;
				border-radius: 40rpx;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
			}
		}
	}
</style>
